<?php
class Core_Library_View_View{
    private $_vars = array();
    private $_view;
    private $_layout;
    public function __construct($controller, $action){ 
        $this->_view = APP_PATH . DS . 'views' . DS . $controller . DS . $action . '.php';
        //$this->_layout = APP_PATH . DS . 'layout' . DS . $controller . 'layout.php';
        $this->_layout = APP_PATH . DS . 'layout' . DS . 'layout.php';
    }
    public function __set($name, $value) {
        $this->_vars[$name] = $value;
    }
    public function __get($name) {
        return $this->_vars[$name];
    }
    public function render(){
       $templateVars = $this->_vars;
       extract($this->_vars, EXTR_OVERWRITE);
       ob_start();
       require_once $this->_view;
       $content_for_layout = ob_get_clean();
       ob_start('ob_gzhandler()');
       require_once $this->_layout;
    }
}
